<%@ page language="java" import="java.io.*,java.util.*,java.sql.*,eSat.*"%>
<%@include file="dbcon.jsp"%>

<%
	String sHtml = "-1";
try
{
	String sTblName	= "";
	String sTblCon	= "";
	String sQry		= "";
	
	if ( request.getParameter("TblName") != null )
		sTblName	= request.getParameter("TblName");
	if ( request.getParameter("TblCond") != null )
		sTblCon	= request.getParameter("TblCond");
	
	sQry ="select * from "+ sTblName +" where "+ sTblCon;
System.out.println(sQry);		
	Statement Stmt = Con.createStatement();
	ResultSet Rs = Stmt.executeQuery(sQry);
	if(Rs.next())
		sHtml = Rs.getString(1);
	Rs.close();
	Stmt.close();
	if ( Con != null ) Con.close();

	response.getWriter().write(sHtml);
}
catch(Exception e)
{ 
	System.out.println(e);
	response.getWriter().write(sHtml);
}
%>
